/**
 * 定义分钟数据模块
 */
(function(window, angular, undefined){
	var module = angular.module('water.apps.WasteWater.reportHistory.reportMinDataManager', ['water.apps.common.report.reportBase']);
	
	module.controller('reportMinDataManagerController',function($rootScope,$scope,$controller,$dateUtil){

		var control = $controller("commonReportController",{$scope:$scope});
		
		$scope.dataAPIName = "minuteListGetter";
		$scope.dataExportAPIName = "exportMinExcel";
		
		/**
		 * 开始时间
		 */
		$scope.startDate;
		/**
		 * 结束时间
		 */
		$scope.endDate;
		
		/**
		 * 获取查询参数
		 * forExcel 是否用于导出
		 */
		$scope.getQueryObject = function(forExcel){

			var startTime =$scope.startDate + " " + $scope.startHour + ":00:00";
			var endTime = $scope.endDate + " " + $scope.endHour + ":55:00";
			var parmsStr = $scope.selectedModel.parmToChecksStr;
			var queryObject = {
					"MN":$scope.selectedModel.MN,
					"PARMS":parmsStr,
					"START":startTime,
					"END":endTime,
					"EXPORT":forExcel
				};
			return queryObject;
		}
		
		/**
		 * 初始化
		 */
		function _init(){
			var endDate = new Date();
			var startDate = $dateUtil.addDay(endDate,-1)
			$scope.startDate = $dateUtil.formatDate(startDate,'yyyy-MM-dd');
			$scope.endDate = $dateUtil.formatDate(endDate,'yyyy-MM-dd');
		}
		
		_init();
		
	});
}(window, angular));	